home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 5 Developer's Kit / vb5 dev kit.iso / dev / desaware / stgtools / reg_demo / strgedit.frm (.txt) < prev   
Encoding:
Visual Basic Form  |  1995-11-02  |  2.4 KB  |  79 lines

  1. VERSION 4.00
  2. Begin VB.Form StringEdit 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Change String Data"
  5.    ClientHeight    =   1365
  6.    ClientLeft      =   1965
  7.    ClientTop       =   3015
  8.    ClientWidth     =   5850
  9.    ClipControls    =   0   'False
  10.    Height          =   1830
  11.    Left            =   1875
  12.    LinkTopic       =   "Form1"
  13.    ScaleHeight     =   1365
  14.    ScaleWidth      =   5850
  15.    Top             =   2640
  16.    Width           =   6030
  17.    Begin VB.CommandButton ButtonCancel 
  18.       Cancel          =   -1  'True
  19.       Caption         =   "Cancel"
  20.       Height          =   375
  21.       Left            =   3360
  22.       TabIndex        =   3
  23.       Top             =   840
  24.       Width           =   1095
  25.    End
  26.    Begin VB.CommandButton ButtonOK 
  27.       Caption         =   "OK"
  28.       Default         =   -1  'True
  29.       Height          =   375
  30.       Left            =   4560
  31.       TabIndex        =   2
  32.       Top             =   840
  33.       Width           =   1095
  34.    End
  35.    Begin VB.TextBox ValueString 
  36.       Height          =   285
  37.       Left            =   240
  38.       TabIndex        =   0
  39.       Top             =   360
  40.       Width           =   5415
  41.    End
  42.    Begin VB.Label Label1 
  43.       BackColor       =   &H00C0C0C0&
  44.       BackStyle       =   0  'Transparent
  45.       Caption         =   "String:"
  46.       Height          =   255
  47.       Left            =   120
  48.       TabIndex        =   1
  49.       Top             =   120
  50.       Width           =   975
  51.    End
  52. Attribute VB_Name = "StringEdit"
  53. Attribute VB_Creatable = False
  54. Attribute VB_Exposed = False
  55. Option Explicit
  56. ' Cancel Button.  Unloads the dialog box without
  57. ' causing any changes.
  58. Private Sub ButtonCancel_Click()
  59.     Unload StringEdit
  60. End Sub
  61. ' OK Button.  Unloads the dialog box, putting the
  62. ' changes in global variables so that the base form
  63. ' can act on them.
  64. Private Sub ButtonOK_Click()
  65.     GlobalValueVariant = ValueString.Text
  66.     GlobalValueSize = Len(GlobalValueVariant)
  67.     If (GlobalValueSize > 0) Then
  68.         If Mid$(GlobalValueVariant, Len(GlobalValueVariant), 1) <> Chr(0) Then
  69.             GlobalValueVariant = GlobalValueVariant & Chr(0)
  70.         End If
  71.     End If
  72.     GlobalValueChanged = True
  73.     Unload StringEdit
  74. End Sub
  75. ' Set the editbox to the old value.
  76. Private Sub Form_Load()
  77.     ValueString.Text = CStr(GlobalValueVariant)
  78. End Sub
  79.